let http = require('http')
let server = http.createServer(function (request, response) {
  let urlStr = request.url
  if (urlStr !== '/favicon.ico') {
    let url = new URL(urlStr, 'http://localhost:8080/')
    let objectUrl = {}
    for (let [k, v] of url.searchParams) {
      objectUrl[k] = v
    }
    response.writeHead(200, {
      'Content-Type': 'application/json;charset=UTF-8'
    })
    response.write(JSON.stringify(objectUrl))
    response.end()
  }

}).listen(8080, function () {
  console.log('服务器已启动，监听端口号为8080')
})